package csel.model.items;

import csel.model.BodyParts;
import csel.model.CharacterStats;
import csel.model.entity.Entity;

public abstract class EquippableItem extends TakeableItem
{
	private static final long serialVersionUID = 6L;
	
	private BodyParts goesOn;
	
	public EquippableItem(String name, String description, int flexPrice, String typeId, BodyParts bodyPart)
	{
		super(name, description, flexPrice, typeId); //TODO
		this.goesOn = bodyPart;
	}
	
	public BodyParts getGoesOn()
	{
		return(goesOn);
	}
	public abstract int applyBonus(CharacterStats cs, int value);

	//		calls touch on entity and if present then removes it.
		public boolean enter(Entity e)
		{
			if(e.touch(this))
			{
				//Is this TDA and LOD WOW??
				this.getLocation().setItem(null);
				return true;
			}
			return false;
		}
		
		public void leave(Entity e)
		{
			//default is that it does nothing........
		}
}
